﻿using Abp.UI;
using System;

namespace ARchGL.Platform.Authorization.Users
{
    public static class StaticUserIds
    {
        /// <summary>
        /// 检查是否是系统信息，如果是则抛出异常
        /// </summary>
        /// <param name="id"></param>
        public static void CheckIsSystemInfo(Guid id)
        {
            if (id.ToString().Contains(BaseId))
                throw new UserFriendlyException("您的请求无效", "当前用户没有权限操作");
        }

        /// <summary>
        /// 系统初始值基础 Guid 前缀，凡是包含这些值的数据都不能被删除
        /// </summary>
        public static string BaseId = "00000000-0000-0000-0000-";

        public static class Host
        {
            /// <summary>
            /// 主机管理员
            /// </summary>
            public static Guid Admin = Guid.Parse($"{BaseId}000000000001");
        }

        public static class Tenants
        {
            /// <summary>
            /// 租户管理员
            /// </summary>
            public static Guid Admin = Guid.Parse($"{BaseId}000000000002");

            /// <summary>
            /// 接口租户
            /// </summary>
            public static Guid UserInterface = Guid.Parse($"{BaseId}000000000003");
        }
    }
}